<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>倒计时</title>
<style>
body { background:url(https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1563947647184&di=000a1f290b9307792836fb04aa712346&imgtype=0&src=http%3A%2F%2Fpic5.40017.cn%2F03%2F000%2F62%2Fd9%2FrB5oQFxJdMSANy1BABWL3nYfEv4341.jpg); background-size:cover; }
#box { position:fixed; left:50%; top:20%; transform: translateX(-50%); text-align:center; white-space:nowrap; text-shadow: 4px 4px 5px black; color:white; s}
#event { font-size:70px; }
#cdtime { font-size:50px; }
</style>
</head>
<body>
<div id=box>
<div id=event>离广珠澳港旅游还有</div>
<div id="cdtime">0天00:00:00</div>
</div>
<script>
var timeEnd= new Date('2019/10/1 12:00:00');

window.onload=function(){
	setInterval("DrawClock()",1000);
}

function DrawClock(){
	var timeNow = new Date();
	var t = timeEnd.getTime() - timeNow.getTime();
	var d = Math.floor(t/(24*60*60*1000));
	t -= d*24*60*60*1000;
	var h = Math.floor(t/(60*60*1000));
	t -= h*60*60*1000;
	var m =Math.floor(t/(60*1000));
	t -= m*60*1000;
	var s = Math.floor(t/1000);
	var zh = h < 10 ? "0" + h : h;
	var zm = m < 10 ? "0" + m : m;
	var zs = s < 10 ? "0" + s : s;            
	document.getElementById("cdtime").innerHTML = d + "天" + zh + ":" + zm + ":" + zs;             
}
</script>
</body>
</html>